
import React, { useState, useEffect, useMemo, useRef } from 'react';
import { Spin } from 'antd';


export default () => {
  let frame = useRef();
  const [spining, setspining] = useState();
  useEffect(() => {
    if (frame.current.attachEvent) {
      frame.current.attachEvent("onload", function () {
        setspining(false)
      });
    } else {
      frame.current.onload = function () {
        setspining(false)
      };
    }
    return
  }, [frame])

  return (

    <div style={{ width: "100%", height: "100%", position: "relative", overflow: "hidden",  }}>
      <Spin spinning={spining} style={{ width: "100%", height: "100%", position: "absolute", left: 0, top: 65 }}></Spin>
      <iframe
        src="http://ap3202.haokuaichong.cn/quick50/index"
        id="isd"
        ref={frame}
        frameBorder="0"
        scrolling="no"
        style={{ width: '100%', height: 'calc(100% + 65px)', position: "absolute", top: -65 }}
      ></iframe>
    </div>

  );
};
